<?php

namespace plugins\statistics;
use cmf\lib\Plugin;


class StatisticsPlugin extends Plugin
{

    public $info = [
        'name'        => 'Statistics',
        'title'       => '数据统计',
        'description' => '数据统计',
        'status'      => 1,
        'author'      => '艾慕科技',
        'version'     => '1.0',
        'demo_url'    => 'http://demo.thinkcmf.com',
        'author_url'  => 'http://www.thinkcmf.com'
    ];

    public $hasAdmin = 0;//插件是否有后台管理界面

    // 插件安装
    public function install()
    {
        return true;//安装成功返回true，失败false
    }

    // 插件卸载
    public function uninstall()
    {
        return true;//卸载成功返回true，失败false
    }

    public function adminDashboard($param)
    {
        $config = $this->getConfig();
        $this->assign($config);
        $dashboard = isset($config['dashboard'])?$config['dashboard']:'/dashboard_one';
        echo $this->fetch($dashboard);
    }

}